import request from '@/utils/request_1'

// 新增上架任务
export const addTaskAdd = (params: any) =>
  request({
    url: '/grounding',
    method: 'post',
    data: { ...params }
  })

// 修改上架任务
export const updateTaskAdd = (params: any) =>
  request({
    url: '/grounding',
    method: 'put',
    data: { ...params }
  })

// 删除上架任务
export const deleteTaskAdd = (params: any) =>
  request({
    url: '/grounding',
    method: 'delete',
    params
  })

// 上架完成
export const completeTaskAdd = (params: any) =>
  request({
    url: '/grounding/complete',
    method: 'put',
    data: params
  })

// 分配
export const distributeTaskAdd = (params: any) =>
  request({
    url: '/grounding/distribute',
    method: 'put',
    data: { ...params }
  })

// 查询全部上架任务
export const findAllTaskAdd = (params: any) =>
  request({
    url: '//grounding/list',
    method: 'get',
    params
  })

// 分页查询上架任务
export const findTaskAddPaging = (params: any) =>
  request({
    url: '/grounding/page',
    method: 'get',
    params
  })

// 分页查询上架任务明细
export const findTaskAddDetailPaging = (params: any) =>
  request({
    url: '/grounding/pageDetail',
    method: 'get',
    params
  })

// 查询上架任务
export const findOneTaskAdd = (id: number) =>
  request({
    url: `/grounding/${id}`,
    method: 'get'
  })
